<template>
	<view class="container">
		<view class="top-container">
			<image class="bg-img" src="/static/images/my/mine_bg_3x.png"></image>
	
			<view  class="user-wrapper">
				<navigator url="/pages/common/login/login" hover-class="opcity" :hover-stay-time="150" class="user">
					<image class="avatar-img" src="/static/images/my/mine_def_touxiang_3x.png"></image>
					
				</navigator>
			</view>
			
		</view>

		<view class="tui-userinfo-box" v-if="userinfo">
			<tui-list-cell padding="0" >
				<view class="tui-list-cell">
					<view>
						<tui-icon name="people" :size='16' color='#333' style="margin-right:20rpx"></tui-icon><text>用户名称</text>
					</view>
					<view class="tui-content">{{userinfo.personName}}</view>
				</view>
			</tui-list-cell>
			<tui-list-cell padding="0" >
				<view class="tui-list-cell">
					<view>
						<tui-icon name="label" :size='16' color='#333' style="margin-right:20rpx"></tui-icon><text>所属部门</text>
					</view>
					<view class="tui-content">{{userinfo.postName}}</view>
				</view>
			</tui-list-cell>
			<tui-list-cell padding="0" >
				<view class="tui-list-cell">
					<view>
						<tui-icon name="voipphone" :size='16' color='#333' style="margin-right:20rpx"></tui-icon><text>所属部门</text>
					</view>
					<view class="tui-content">{{userinfo.postName}}</view>
				</view>
			</tui-list-cell>
			

		</view>
		<!--tabbar-->
		<view class="tui-logout">
			<tui-button height="88rpx" shadow :size="30" type="blue" shape="circle" @click="doLogout">退出</tui-button>
		</view>

	</view>
</template>

<script>
	import {
		mapState
	} from 'vuex';
		import {
			mapMutations
		} from "vuex";
	export default {
		computed: mapState(['isLogin', 'userinfo']),
		data() {
			return {
				info: null,
			};
		},
		onShow: function() {
			console.log(this.userinfo)

			// this.getUserinfoDetail()
		},
		methods: {
				...mapMutations(["logout"]),
			getUserinfoDetail() {
				this.loadding = true;
				this.tui.request("/api/user/info", "GET", {}, false, false, true).then(res => {
					this.info = res.data

				})
			},
			doLogout: function() {
				this.tui.modal("提示", "确定退出登录？", true, (res) => {
					if (res) {
						uni.clearStorage();
						this.logout();
						uni.reLaunch({
							url: '/pages/login/login/login'
						});
					}
				})
			},
		
	

		},
		onNavigationBarButtonTap(e) {
			if (e.index === 0) {
				// #ifdef APP-PLUS
				const subNVue = uni.getSubNVueById('share');
				subNVue.show('slide-in-bottom', 250);
				// #endif
			}
		}
	};
</script>

<style>
	.container {
		position: relative;
		padding-bottom: 100rpx;
	}

	.top-container {
		height: 440rpx;
		position: relative;
		display: flex;
		flex-direction: column;
	}

	.bg-img {
		position: absolute;
		width: 100%;
		height: 440rpx;
	}
	.tui-logout{
		width: 100%;
		position: fixed;
		left: 0;
		bottom: 100rpx;
		z-index: 999;
		padding: 10rpx 25rpx 15rpx;
		box-sizing: border-box;
		
	}
	.logout {
		width: 110rpx;
		height: 36rpx;
		display: flex;
		flex-direction: row;
		align-items: center;
		margin: 42rpx 0 24rpx 32rpx;
		position: relative;
		z-index: 2;
	}

	.logout-img {
		width: 36rpx;
		height: 36rpx;
		margin-right: 11rpx;
	}

	.logout-txt {
		font-size: 28rpx;
		color: #fefefe;
		line-height: 28rpx;
	}

	.user-wrapper {
		display: flex;
		justify-content: center;
		position: relative;
		z-index: 2;
	}

	.user {
		display: flex;
		flex-direction: column;
		justify-content: center;
		position: relative;
		z-index: 2;
	}

	.avatar-img {
		width: 160rpx;
		height: 160rpx;
		border-radius: 50%;
		align-self: center;
	}

	.user-info {
		display: flex;
		flex-direction: row;
		margin-top: 30rpx;
		align-items: center;
	}

	.user-info-mobile {
		margin-top: 30rpx;
		position: relative;
		font-size: 28rpx;
		color: #fefefe;
		line-height: 28rpx;
		align-self: center;
		padding: 0 50rpx;
	}

	.edit-img {
		position: absolute;
		width: 42rpx;
		height: 42rpx;
		right: 0;
		bottom: -4rpx;
	}

	.edit-img>image {
		width: 42rpx;
		height: 42rpx;
		padding-left: 25rpx;
	}

	.middle-container {
		height: 138rpx;
		display: flex;
		flex-direction: row;
		align-items: center;
		border-radius: 10rpx;
		background-color: #ffffff;
		margin: -30rpx 30rpx 26rpx 30rpx;
		box-shadow: 0 15rpx 10rpx -15rpx #efefef;
		position: relative;
		z-index: 2;
	}

	.middle-item {
		height: 100%;
		display: flex;
		flex-direction: row;
		align-items: center;
	}

	.ticket-img {
		width: 80rpx;
		height: 80rpx;
		margin-left: 65rpx;
	}

	.middle-tag {
		font-size: 28rpx;
		color: #333333;
		line-height: 28rpx;
		font-weight: bold;
		padding-left: 22rpx;
	}

	.car-img {
		width: 80rpx;
		height: 80rpx;
		margin-left: 97rpx;
	}

	.bottom-container {
		height: 334rpx;
		display: flex;
		flex-direction: column;
		justify-content: space-between;
		padding: 40rpx 74rpx 40rpx 95rpx;
		margin: 0 30rpx;
		background-color: #ffffff;
		border-radius: 10rpx;
		box-sizing: border-box;
		box-shadow: 0 0 10rpx #efefef;
	}

	.ul-item {
		display: flex;
		flex-direction: row;
		justify-content: space-between;
	}

	.item {
		display: flex;
		flex-direction: column;
		align-items: center;
		position: relative;
	}

	.item-img {
		width: 32rpx;
		height: 32rpx;
	}

	.item-name {
		padding-top: 13rpx;
		font-size: 24rpx;
		color: #666666;
		min-width: 80rpx;
		text-align: center;
	}

	.btn-feedback {
		background: transparent !important;
		position: absolute;
		height: 100%;
		width: 100%;
		left: 0;
		top: 0;
		border: 0;
	}

	.btn-feedback::after {
		border: 0;
	}

	.tui-userinfo-box {
		margin: 10rpx 0;
		color: #333;
	}

	.tui-list-cell {
		width: 100%;
		display: flex;
		align-items: center;
		justify-content: space-between;
		/* padding: 24rpx 60rpx 24rpx 30rpx; */
		box-sizing: border-box;
		font-size: 30rpx;
	}



	.tui-content {
		font-size: 26rpx;
		color: #666;
	}
</style>
